package com.b2b.util;


import com.b2b.model.ServiceDto;
import com.b2b.model.entity.Orders;
import com.b2b.model.entity.Service;
import com.b2b.model.entity.goods.Goods;
import com.b2b.service.CompanyInfoService;
import com.b2b.service.ServiceService;
import com.b2b.service.goodsService.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Component
public class ServiceUtil {

    public ServiceDto getServiceDto(Service service){
        ServiceDto serviceDto = new ServiceDto();

        serviceDto.setServiceId(service.getServiceId());
        serviceDto.setType(service.getType());
        serviceDto.setApplicationTime(service.getApplicationTime());
        serviceDto.setReason(service.getReason());
        serviceDto.setResult(service.getResult());
        serviceDto.setState(service.getState());
        serviceDto.setEvaluate(service.getEvaluate());
        serviceDto.setOrderId(service.getOrderId());
        serviceDto.setStockId(service.getStockId());

        return serviceDto;
    }

    public Service getService(ServiceDto serviceDto){
        Service service = new Service();

        service.setServiceId(serviceDto.getServiceId());
        service.setType(serviceDto.getType());
        service.setApplicationTime(serviceDto.getApplicationTime());
        service.setReason(serviceDto.getReason());
        service.setResult(serviceDto.getResult());
        service.setState(serviceDto.getState());
        service.setEvaluate(serviceDto.getEvaluate());
        service.setOrderId(serviceDto.getOrderId());
        service.setStockId(serviceDto.getStockId());

        return service;
    }

}
